<?php
/* JoomLeague League Management and Prediction Game for Joomla!
 * @version $Id: show_frontpage.tpl.php 1186 2008-07-04 11:22:48Z julienv $
 * @package Joomleague
 * @copyright Copyright (C) 2007  JoomLeague
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see _joomleague_license.txt
 *  
 * Homepage: http://www.joomleague.de
 * Support: htt://www.joomleague.de/forum/
 * 
 * This file is part of JoomLeague.
 *  
 * JoomLeague is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Please note that the GPL states that any headers in files and
 * Copyright notices as well as credits in headers, source files
 * and output (screens, prints, etc.) can not be removed.
 * You can extend them with your own credits, though...
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * The "GNU General Public License" (GPL) is available at
 * http://www.gnu.org/copyleft/gpl.html.
 */
 
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
?>
<div id="joomleague">
<!-- Header with Project Name-->
<div align="center" class="sectiontableheader">
<!-- Project Name-->
<?php 
if ($x < $fp_config['fp_max_project_load_per_season']) 
{
  ?>
  <a href="javascript:void(0)" onclick="switchMenu('p<?php echo $joomleague->id;?>');">
  <?php 
}
$round_id = (isset($rounds[$current_round-1])) ? $rounds[$current_round-1]->id : 0;
  
$htmlHelper->show_matchdays_title($htmlHelper->showTitle($joomleague, $overall_config['project_heading_type']), $round_id, $results_config);
  
if ($x < $fp_config['fp_max_project_load_per_season']) { 
  ?></a><?php 
} 
?>
&nbsp;<a href="<?php
				echo sefRelToAbs(
				  JL_COMPONENT_LINK 
				  . '&amp;p='.$joomleague->id
				  . '&amp;func=showResultsRank'
				  . JL_ITEMID_SUFFIX );
				?>" style="font-size:9px">[&gt;&gt;&gt;]</a>
</div>
<br/>

<?php
if ($x < $fp_config['fp_max_project_load_per_season']) 
{
  ?>
  <!-- start display details -->
  <div id="p<?php echo $joomleague->id;?>" style="display:<?php echo $status;?>" class="projectsummary">
	    <?php 
	    if ( $joomleague->project_type != 'SIMPLE_KO' 
	      && $fpage_config['show_ranking_table'] == 1 ) 
	    {
	      ?>
			    <!-- ranking START -->
          <div class="ranking">
			    <?php
					foreach ( $current_ranking as $key => $cu_rk ) 
					{
					  if ($key) 
					  {
					    echo '<div class="divisiontitle">';
					      $htmlHelper->show_ranking_division_title($key);
					    echo '</div>';
					  }
					  ?>
					  <table class="rankingtable">
					  <?php
					  $htmlHelper->show_ranking_heading($type,$table_config);
					  $htmlHelper->show_ranking_entries($cu_rk, $previous_ranking[$key], array(), array(), $type, $table_config);
					  ?>
					  </table>
					  <?php
					}
	        ?>
          </div>
          <!-- ranking END -->
        <?php
		  }
		  
	    if ( $fpage_config['show_results_table'] == 1 ) 
	    {
	      echo '<div class="results">';
	      	      
        $htmlHelper->resultsColspan($results_config);
						
				// first, current gameday
				if ( count( $matches ) > 0 ) 
				{
				  ?>
          <!-- results START -->
          <div class="matchdaytitle">
          <?php 
          echo '<a href="'.sefRelToAbs(JL_COMPONENT_LINK
                          . '&amp;p='.$joomleague->id.JL_ITEMID_SUFFIX
                          . '&amp;func=showResults&amp;r='.$round). '">'
              . _JL_FRONTPAGE_CURRENT_MATCHDAY
              .'</a>'; 
          ?>
          </div>
				  <table class="resulttable">
				  <?php				
				  $htmlHelper->show_matches($matches, $resultTeams, $results_config);
				  ?>
				  </table>
          <!-- results END -->
				  <?php
				}
						
				// next gameday
				if ( is_array( $next_matches ) && ( count( $next_matches ) > 0 ) )
				{
          ?>
          <!-- results START -->
          <div class="matchdaytitle">
          <?php 
          echo '<a href="'.sefRelToAbs(JL_COMPONENT_LINK.'&amp;p='.$joomleague->id
             . '&amp;func=showResults&amp;r='.($round+1)).JL_ITEMID_SUFFIX.'">'
             . _JL_FRONTPAGE_NEXT_MATCHDAY.'</a>';
          ?>
          </div>
          <table class="resulttable">
          <?php				     
				  $htmlHelper->show_matches($next_matches, $resultTeams, $results_config);
          ?>
          </table>
          <!-- results END -->
          <?php
				}
								
        echo '</div>'; 
      }
      ?>
      <div class="clear"></div>
    </div>
  <?php 
} 
?>
</div>
